package depot;

public class Customer {
	
	private int seqNo;
	private Name customerName;
	private String parcelID;
	
	/**
	 * the constructor of customer
	 */
	public Customer(int seqNo, Name customerName, String parcelID) throws IDFormatException{
		
		
	  this.seqNo = seqNo;
	  this.customerName = customerName;
	  
	   //check whether the id format of parcel is fine
	  String firstLetter_ID = parcelID.substring(0, 1);
		
		if(firstLetter_ID.equals("L") || firstLetter_ID.equals("N")){
			
			//check the length of parcel id
			if(parcelID.length() == 4){
				this.parcelID = parcelID;
			}else{
				throw new IDFormatException(parcelID);
			}
			
		}
		else
		{
			throw new IDFormatException(parcelID);
		}
	}
	
	/**
	 * 
	 * @return seqNo the sequence no of customer
	 */
    public int getSeqNo(){
		
		return seqNo;
	}
    
    /**
     * 
     * @return name the full name of customer
     */
	public Name getName(){
		
		return customerName;
	}
	
	/**
	 * 
	 * @return parcelID the parcelID of parcel
	 */
	public String getParcelID(){
		
		return parcelID;
	}

}